<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>ajax练习</title>
</head>
<body>
<script>
    //首先要实例化一个xml对象
    //var request=new XMLHttpRequest();
    //兼容浏览器
    var request;
    if (window.XMLHttpRequest()){
        request=new XMLHttpRequest();//兼容IE7，firefox,chrome,safari浏览器
    }
    else{
        request=new ActiveXObject("Microsoft.XMLHTTP");//IE6,IE5
    }

    request.open('POST','post.php',true);
    request.setRequestHeader('Content-type','application/x-www-form-urlencoded');//设置提交的头部信息为表单提交
    request.send('name=xiangjiang&sex=man');



</script>


</body>
</html>